﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Configuration;

/// <summary>
/// Summary description for SecureSession
/// </summary>
public class SecureSession
{
	public SecureSession()
	{
        HttpContext.Current.Session.Timeout = 120;        
	}    

    public void isActive()
    {        
        if (HttpContext.Current.Session[FormContract.CONSENT_STATUS] == null)
            HttpContext.Current.Response.Redirect(ConfigurationManager.AppSettings["RedirectUrl"]);
    }

    #region Public Property
    public bool ConsentStatus
    {
        get
        {
            if (HttpContext.Current.Session[FormContract.CONSENT_STATUS] != null)
                return (bool)HttpContext.Current.Session[FormContract.CONSENT_STATUS];
            return false;
        }
    }
    #endregion
}
